<?php

namespace App\Http\Controllers;


use Illuminate\Http\Request;

class WechatController extends Controller
{
    public function serve(){
    $app= \EasyWeChat::work();
    \Log::channel('wechatServe')->info('我进来了');
    $app->server->push(function($message){

       /* \Log::channel('wechatServe')->info('事件触发',$message);
            return "欢迎关注 overtrue！";*/
        });
    return  $app->server->serve();

    }
    public function addressBook(Request $request){
        $app= \EasyWeChat::work();
        \Log::channel('wechatServe')->info('通讯录变更',$request->all());
        $app->server->push(function($message){
            \Log::channel('wechatServe')->info('通讯录变更',$message);
            /* \Log::channel('wechatServe')->info('事件触发',$message);
                 return "欢迎关注 overtrue！";*/
        });
        return  $app->server->serve();
    }
}
